import Vue from 'vue';
import Router from 'vue-router';
import commonrounter from './commonrouter.js';

Vue.use(Router);

export default new Router({
	routes: [{
			path: '/',
			redirect: '/dashboard',

		},
		{
			path: '/',
			component: resolve => require(['../components/common/Home.vue'], resolve),
			meta: {
				title: '自述文件'
			},
			children: [
				...commonrounter,
				{
					path: '/dashboard',
					component: resolve => require(['../components/page/Dashboard.vue'], resolve),
					meta: {
						title: '系统首页'
					}
				},
				{
					path: '/dictype',
					component: resolve => require(['../components/page/common/dictype/list.vue'], resolve),
					meta: {
						title: '字典分类'
					}
				},
				{
					path: '/table',
					component: resolve => require(['../components/page/BaseTable.vue'], resolve),
					meta: {
						title: '基础表格'
					}
				},
				{
					path: '/onlineservice',
					component: resolve => require(['@/components/page/chat'], resolve),
					meta: {
						title: '在线客服'
					}
				},
				{
					// 富文本编辑器组件
					path: '/joblist',
					component: resolve => require(['../components/page/common/dic/customizelist.vue'], resolve),
					meta: {
						title: '职位管理'
					}
				},
				{
					// markdown组件
					path: '/companylist',
					component: resolve => require(['../components/page/company/list.vue'], resolve),
					meta: {
						title: '机构管理'
					}
				},
				{
					// 图片上传组件
					path: '/projectlist',
					component: resolve => require(['../components/page/project/list.vue'], resolve),
					meta: {
						title: '项目管理'
					}
				},
				{
					// 图片上传组件
					path: '/projectinvsetlist',
					component: resolve => require(['../components/page/projectinvest/list.vue'], resolve),
					meta: {
						title: '融资信息'
					}
				},
				{
					// 拖拽列表组件
					path: '/supportstafflist',
					component: resolve => require(['../components/page/common/user/list.vue'], resolve),
					meta: {
						title: '客服管理'
					}
				},
				{
					// 权限页面
					path: '/information',
					component: resolve => require(['@/components/page/news/list'], resolve),
					meta: {
						title: '新闻资讯'
					}
				},{
					path: '/chat',
					component: resolve => require(['@/components/page/chat'], resolve),
					meta: {
						title: '聊天'
					}
				}
			]
		},
		{
			path: '/login',
			component: resolve => require(['../components/page/common/user/login.vue'], resolve),

		},
		{
			path: '/contacts',
			component: resolve => require(['../components/page/onlineservice/contacts.vue'], resolve),
			meta: {
				title: '在线客服'
			}
		},
		{
			path: '/404',
			component: resolve => require(['../components/page/404.vue'], resolve)
		},
		{
			path: '/403',
			component: resolve => require(['../components/page/403.vue'], resolve)
		},
		{
			path: '*',
			redirect: '/404'
		}
	]
})